<template>
    <div class="TaskWarp" :class="{teachDivMain:BeginTeaching}">
        <div class="divMain LianXian" @click.stop>
            <div class="divTitle">
                <h2>{{Questions.child.QuestionRemark}}</h2>
            </div>
            <div class="LianXianWarp">
                <!--<canvas class="canvas"></canvas>-->
                <!--<canvas class="backgroundCanvas"></canvas>-->
                <div class="show topBottom cb">
                    <div class="showtop">
                        <!--上侧-->
                        <span v-for="(item,index) in Questions.child.stem[0].opts"
                              v-if="index%2 == 0" class="showitem" v-html="item.OptionContent">
                        </span>
                    </div>
                    <div class="showbottom">
                        <!--下侧-->
                        <span v-for="(item,index) in Questions.child.stem[0].opts"
                              v-if="index%2 == 1" class="showitem"
                              v-html="item.OptionContent"></span>
                    </div>
                </div>
            </div>
        </div>
        <div class="Close" v-show="!BeginTeaching">
            <i class="el-icon el-icon-close"></i>
        </div>
    </div>
</template>

<script>
    import {mapGetters, mapActions} from 'vuex'
    export default {
        name: "LianXian",
        props: ["Questions"],
        computed: mapGetters([
            'BeginTeaching'
        ]),
        methods: {},
        mounted() {

            $('.LianXianWarp').height(parseFloat($('.LianXian').height()) - 80)
            $('.showitem p').css({
                lineHeight:$('.showitem p').height()+'px'
            })

            window.onresize = function () {
                $('.LianXianWarp').height(parseFloat($('.LianXian').height()) - 80)
                $('.showitem p').css({
                    lineHeight:$('.showitem p').height()+'px'
                })
            }
            $('.showitem img').each(function () {
                $(this).upImgSrc()
            })


        },
        data () {
            return {}
        }
    }


</script>
<style lang="scss" rel="stylesheet/scss">
    @import '../../../assets/css/public.scss';

    .LianXian {
        height: 100%;

        .showbottom .showitem p {
            display: block;
            width: 100%;
            height: 100%;
            position: relative;
            img {
                display: block;
                height: 100%;
                width: auto;
                position: absolute;
                left: 0;
                right: 0;
                margin: 0 auto;
            }
        }

        .show.topBottom .showitem {
            box-shadow: $boxShadow;
        }

        .showitem {
            width: 20%;
            height: 60%;
            margin: 0 10px;
            p{
                height: 100%;
            }
        }
    }
</style>
<style lang="scss" rel="stylesheet/scss" scoped>
    @import '../../../assets/css/public.scss';

    .TaskWarp {
        height: 90%;
        width: 90%;
        position: absolute;
        left: 0;
        right: 0;
        top: 0;
        bottom: 0;
        margin: auto;
        .divMain {
            position: absolute;
            overflow: hidden;
            height: 100%;
            width: 100%;
            .divTitle {
                height: 80px;
                background: #fff;
                position: relative;
                box-shadow: 0 10px 20px 2px rgba(197, 208, 218, 0.8);
                z-index: 1;
                h2 {
                    font-size: 20px;
                    line-height: 80px;
                    color: #56545A;
                }
            }
            .LianXianWarp {
                background: #F8FAFC;
                position: relative;
                height: 100%;
                overflow: auto;
                padding: 40px auto 0;
                overflow: hidden;
                .show.topBottom {
                    height: 100%;
                    background: #F8FAFC;
                    .showtop, .showbottom {
                        height: 50%;
                        display: flex;
                        flex-wrap: nowrap;
                        justify-content: center;
                        .showitem {
                            background: #fff;
                            border-radius: 15px;
                            text-align: center;
                            color: #000000;
                            overflow: hidden;
                            position: relative;
                        }
                        .showitem:before{
                            position: absolute;
                            left: 0;
                            right: 0;
                            margin: auto;
                            display: block;
                            content: '';
                            width: 16px;
                            height: 16px;
                            box-shadow: 0 0 10px rgba(255,125,125,.6) inset;
                            border-radius: 50%;
                        }
                    }
                    .showtop {
                        margin-top: 60px;
                        .showitem:before{
                            bottom: 10px;
                        }
                    }
                    .showbottom {
                        .showitem:before{
                            top: 10px;
                        }
                    }
                }
            }
        }
    }

</style>
